package com.github.chxiaowu.common;

/**
 * 错误码，均为自定义
 */
public enum ResultCode {
	SUCCESS(0, "成功"),
	FAIL(-1, "失败"),
	UNAUTHORIZED(20001, "资源未授权"),
	NOT_FOUND(20002, "资源不存在"), 
	SESSION_TIMEOUT(20003, "会话超时"), 
	PARAMETER_MISSING(20004, "缺少必要参数"),
	PARAMETER_ERROR(20005, "参数校验失败"),
	SERVER_ERROR(20006, "服务器内部错误"),
	RESOURCE_DUPLICATE(20007, "资源重复"),
	RESOURCE_NOT_CONFIG(20008, "资源没有配置"),
	BUSSINESS_ERROR(20009, "业务处理错误"),
	;

	private final int code;

	private final String desc;

	ResultCode(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	public int code() {
		return code;
	}

	public String desc() {
		return desc;
	}
}